package com.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.Dao.typedao;
import com.page.page;

public class pagequerygoodstype extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
			this.doPost(request, response);
	}

	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		String curr = request.getParameter("curr");
		int currentpage = 1;
		try{
			currentpage = Integer.parseInt(curr);
		}catch(Exception e){
			currentpage = 1;
		}
		typedao tdao = new typedao();
		page p = tdao.pagequerytype(currentpage);
		
		request.getSession().setAttribute("typepage", p );
		request.getSession().setAttribute("typeface", 4);
		response.sendRedirect(request.getContextPath()+"/background/typelist.jsp");
		
		
	}

	

}
